package com.xiaoKe.zhonghzu.global.okhttp;

/**
 * @ProjectName : A3
 * @Author : Shijingna
 * @Time : 2024/9/3 15:10
 * @Description : 文件描述
 */
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonSerializer {
    private static Gson gson = new GsonBuilder().create();

    public static String objectToJson(Object object) {
        return gson.toJson(object);
    }

    public static <T> T jsonToObject(String jsonString, Class<T> classOfT) {
        return gson.fromJson(jsonString, classOfT);
    }
}
